package com.gxc.mq.provider;

import com.gxc.config.QueueConfigBean;
import com.gxc.entity.User;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author GongXincheng
 * @since 2019-09-03 13:42
 */
@Component
public class TestTopicProvider {

    @Resource
    private AmqpTemplate amqpTemplate;

    public void sendMessage(User user) {
        amqpTemplate.convertAndSend(QueueConfigBean.TOPIC_EXCHANGE_NAME, "com.la.aaa", user);
    }

}
